#!/bin/sh

set -eu

count=$(grep -c "$1" "$TEST_DIR/sql_res.$TEST_NAME.txt")
if [ $count != $2 ]; then
    echo "TEST FAILED: OUTPUT CONTAINS '$1' for $count times, which supposed to be $2 times"
    echo "____________________________________"
    cat "$TEST_DIR/sql_res.$TEST_NAME.txt"
    echo "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"
    exit 1
fi
